<template>
  <div>
    <Header></Header>
    <!-- 路由 -->
    <router-view></router-view>
    <!-- meta.isHidden为true时，跳转该路由，Footer组件不显示 -->
    <Footer v-show="!$route.meta.isHidden"></Footer>
  </div>
</template>

<script>
import Header from "./components/Header";
import Footer from "./components/Footer";
export default {
  /* 
    1.开发工具中搜索组件的时候,需要使用name
    2.<keep-alive include='name'></keep-alive>
    3.全局注册组件的时候需要使用name
  */
  name: "App",
  mounted() {
    /* 调用ajax */
    this.requestCategoryList();
  },
  methods: {
    /* 发送Ajax请求 */
    requestCategoryList() {
      this.$store.dispatch("reqCategoryList");
    },
  },
  components: {
    Footer,
    Header,
  },
};
</script>

<style>
</style>